
function printmessageinfo(messagerequestids) {
	if (messagerequestids != null && messagerequestids != "null") {
		window.setTimeout(function () {
			ActionMessage.readMessage(messagerequestids, function (data) {
				var actionmessagediv = document.getElementById("actionmessage");
				if (typeof actionmessagediv == "object") {
					if (typeof actionmessagediv.length == "number") {
						actionmessagediv = actionmessagediv[0];
					}
				}
				if (actionmessagediv && data) {
					actionmessagediv.style.display = "block";
					dwr.util.setEscapeHtml(false);
					dwr.util.setValue("actionmessage", data[1]);
					if (data[0] == "1") {
						actionmessagediv.className = "action-msg-success";
					} else {
						if (data[0] == "2") {
							actionmessagediv.className = "action-msg-alert";
						} else {
							if (data[0] == "3") {
								actionmessagediv.className = "action-msg-error";
							}
						}
					}
					//window.setTimeout(function (){
					//	actionmessagediv.style.display = "none";
					//	},3000);					
					//flashMessageFadeIn("actionmessage",30,300,2000,50,2000);						
					
				} else {
					actionmessagediv.style.display = "none";
				}
			});
		}, 500);
	}
	
}
function printTypeMessageinfo(msg, type) {
	var actionmessagediv = document.getElementById("actionmessage");
	if (actionmessagediv && msg) {
		dwr.util.setValue("actionmessage", msg);
		if (type == 1) {
			actionmessagediv.className = "action-msg-success";
		} else {
			if (type == 2) {
				actionmessagediv.className = "action-msg-alert";
			} else {
				if (type == 3) {
					actionmessagediv.className = "action-msg-error";
				}
			}
		}
		actionmessagediv.style.display = "block";
	} else {
		actionmessagediv.style.display = "none";
	}
}
function resetmessageinfo() {
	var actionmessagediv = document.getElementById("actionmessage");
	if (actionmessagediv) {
		actionmessagediv.style.display = "none";
	}
}

function flashMessageSetOpacity(id, level) {
	var element = document.getElementById(id);
	element.style.display = "inline";
	element.style.zoom = 1;
	element.style.opacity = level;
	element.style.MozOpacity = level;
	element.style.KhtmlOpacity = level;
	element.style.filter = "alpha(opacity=" + (level * 100) + ");";
}
function flashMessageFadeIn(id, steps, duration, interval, fadeOutSteps, fadeOutDuration) {
	var fadeInComplete;
	for (i = 0; i <= 1; i += (1 / steps)) {
		setTimeout("flashMessageSetOpacity('" + id + "', " + i + ")", i * duration);
		fadeInComplete = i * duration;
	}
	setTimeout("flashMessageFadeOut('" + id + "', " + fadeOutSteps + ", " + fadeOutDuration + ")", fadeInComplete + interval);
}
function flashMessageFadeOut(id, steps, duration) {
	var fadeOutComplete;
	for (i = 0; i <= 1; i += (1 / steps)) {
		setTimeout("flashMessageSetOpacity('" + id + "', " + (1 - i) + ")", i * duration);
		fadeOutComplete = i * duration;
	}
	setTimeout("flashMessageHide('" + id + "')", fadeOutComplete);
}
function flashMessageHide(id) {
	document.getElementById(id).style.display = "none";
}

